﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>查看子账号</title>
    <meta name="keywords" content="翻倍花，O2O，第三方推广，服务平台">
    <meta name="description" content="翻贝网致力于打造国内最具公信力的第三方推广和服务平台">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <style>
        body,h1,h2,h3,h4,h5,h6,div,p,dl,dt,dd,ol,ul,li,form,table,th,td,a,img,span,strong,var,em,input,textarea,select,option{margin: 0; padding: 0;}
        ul,ol{list-style: none;}
        img{border: 0;}
        input,select,textarea{outline:0;border:none;}
        html,body{font-family: "微软雅黑"}
        textarea{resize:none;}
        table{border-collapse: collapse; border-spacing: 0;}
        a{text-decoration: none;color: #000;}
        h2{font-weight: normal;}
        /*=========================重置样式==========================*/
        .promit_mark{width: 100%;position: fixed;top: 0;left: 0;z-index: 1000;display: none;}
        .content{width: 1000px;margin: 0 auto;}
        .header{padding: 20px 0;overflow: hidden;border-bottom: 1px solid #eee;}
        .header p{float: left;font-size: 18px;}
        .header .edit{float: right;font-size: 16px;color: #9955c6;padding: 0 20px;background: url({{env('IMAGE_DOMAIN')}}images/shop/bgs/edit.png) 0 4px no-repeat;}
        .content .title{font-size: 18px;}
        .account_message p{overflow: hidden;margin: 10px 0;}
        .account_message .message span:nth-child(1){float: left;width: 67px;text-align: right;margin-right: 10px;line-height: 30px;color: #808080;}
        .account_message .message span:nth-child(2){float: left;line-height: 30px;color: #808080;}
        .account_message .message input[type="text"]{float: left;width: 200px;height: 30px;padding: 5px;border: 1px solid #666;}
        .account_message .message .get_yzm{width: 100px;background-color: #9955c6;color: #fff;height: 30px;border-radius: 3px;padding: 5px;border: none;margin-left: 20px;}
        .power{margin: 0 20px;}
        .power li{padding: 10px 0;border-bottom: 1px solid #eee;}
        .power li .shop_name{font-size: 14px;margin-bottom: 10px;overflow: hidden;}
        .power li .shop_name span{float: left;font-weight: 600;}
        .power li .shop_name a{float: right;color: red;}
        .power li .shop_location{font-size: 12px;color: #808080;margin: 5px 0;}
        .power li .shop_power{font-size: 12px;color: #808080;margin: 5px 0;}
        .prompt{width: 300px;position: absolute;top: 200px;left: 50%;margin-left: -150px;box-shadow: 0px 0px 5px 5px rgba(128,128,128,0.5);background-color: #fff;display: none;z-index: 1001;}
        .prompt .title{overflow: hidden;width: 100%;height: 50px;line-height: 50px;}
        .prompt .title span{float: left;font-size: 16px;color: #808080;margin-left: 15px;}
        .prompt .title img{float: right;width: 20px;margin-top: 15px;margin-right: 15px;cursor: pointer;}
        .prompt .prompt_content{padding: 15px 30px;font-size: 14px;}
        .prompt .button{overflow: hidden;}
        .prompt .button span{padding: 15px 50px;font-size: 16px;cursor: pointer;}
    </style>
</head>
<body>
    <p class="promit_mark"></p>
    <div class="content">
        <div class="header">
            <p>
                <span>详情</span>
            </p>
            <a class="edit" href="/shop/admin/account/edit?subaccountid={{$shopuserid}}">编辑</a>
        </div>
        <div class="account_message">
            <p class="message">
                <span>姓名</span>
                <span>{{$shopusername}}</span>
            </p>
            <p class="message">
                <span>手机号</span>
                <span>{{$shopusermobile}}</span>
            </p>
        </div>

        <div class="title">功能权限</div>
        <ul class="power">
            @foreach($shoplists as $list)
            <li>
                <p class="shop_name">
                    <span>{{$list['shopname']}}</span>
                    @if($status)
                        <a href="#" onclick="promptBox('{{$list['shopid']}}','{{$list['shopname']}}')">停用</a>
                    @else
                        <a href="#" style="color: #808080;">已停用</a>
                    @endif
                </p>
                <p class="shop_location">
                    {{$list['address']}}
                </p>
                <p class="shop_power">
                    子账号权限：
                    @if(in_array('Admin', $list['authlists']))
                        权限受理、
                    @endif
                    @if(in_array('Account', $list['authlists']))
                         买单收银、
                    @endif
                    @if(in_array('OrderManager', $list['authlists']))
                        订单管理、
                    @endif
                    @if(in_array('CommentManager', $list['authlists']))
                        评价管理、
                    @endif
                    @if(in_array('CollectMoney', $list['authlists']))
                         财务结款、
                    @endif
                    @if(in_array('DoubleCalendar', $list['authlists']))
                         翻倍日管理及ktv/酒店夜场专场、
                    @endif
                    查看翻倍日历、地推管理、专属二维码
                </p>
            </li>
           @endforeach
        </ul>
    </div>
    <div class="prompt">
        <p class="title">
            <span>确认提示</span>
            <img src="{{env('IMAGE_DOMAIN')}}images/close_p.png" alt="">
        </p>
        <p class="prompt_content">
            <input type="hidden" name="subaccountid" value="" />
            <input type="hidden" name="subaccountshopid" value="" />
            确定对{{$shopusername}}在
            <span class="prompt_shop_user"></span>
            的子账号停用么？
        </p>
        <p class="button">
            <span class="cancel" style="float: left;">取消</span>
            <span class="sure" style="float: right;">确定</span>
        </p>
    </div>
    <script src="{{env('JS_DOMAIN')}}js/jquery-1.11.1.min.js?v={{env('JS_VERSION')}}"></script>
    <script>
        //停用TODO
        var shopusermobile = '{{$shopusermobile}}';
        var shopuserid = '{{$shopuserid}}';
        function promptBox(shopid, shopname){
            $(".prompt_shop_user").html(shopname);
            $(".prompt_content input[name='subaccountshopid']").val(shopid);
            $(".prompt").show();
            $(".promit_mark").show();
            $(".promit_mark").height($(window).height());
        }
        $(".cancel").click(function(){
            $(".prompt").hide();
            $(".promit_mark").hide();
        })
        $(".prompt .title img").click(function(){
            $(".prompt").hide();
            $(".promit_mark").hide();
        })
        $(".sure").click(function(){
            var subaccountshopid = $(".prompt_content input[name='subaccountshopid']").val();
            $.ajax({
                url: '/shop/admin/account/disable',
                type: 'post',
                data: {
                    'subaccountid':shopuserid,
                    'shopid':subaccountshopid
                },
                dataType:'json',
                success:function(data){
                    if(data.status == 'success') {
                        alert(data.message);
                        window.location.reload();
                    } else {
                        alert(data.message);
                        return;
                    }
                }
            });
        });
    </script>
</body>
</html>